package encrypt;

/**
 * @auther hanchao
 * @date 2016/12/8 18:43
 */
public class Base24Util {
    private static final String DECODE_MAP = "BCDFGHJKMPQRTVWXY2346789";

    private static String encode(String text){
        int i =0;
        int pos = 0;
        char [] buff = new char[text.length()<<1];
        while((i=pos)<text.length()){
            buff[i<<1] = DECODE_MAP.charAt((text.charAt(pos)) >> 4);
            buff[(i<<1) + 1] = DECODE_MAP.charAt(23 - (text.charAt(pos) & 0x0F));
            pos++;
        }
        return new String(buff);
    }

    public static void main(String[] args){
        System.out.println(encode("4654454545"));
    }
}
